﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;//Please add references
namespace dzs.DAL
{
	/// <summary>
	/// 数据访问类:distribution
	/// </summary>
	public partial class distribution
	{
		public distribution()
		{}
		#region  BasicMethod

        public int getuid(int did)
        {
            int i=0;
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select uid from vmonthstore");
            strSql.Append(" where monthSupplyPlanId=@monthSupplyPlanId");
            SqlParameter[] parameters = {
					new SqlParameter("@monthSupplyPlanId", SqlDbType.Int,4)
			};
            parameters[0].Value = did;
            object o= DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (o != null)
            {
                i = int.Parse(o.ToString());
            }
            return i;
        }

        public bool Updatedatestatus(int ks,int js)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");
            strSql.Append("dstate=-1 ");
            strSql.Append(" where dstate=0");           
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool Existsmaterial(int did)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from materialinfo");
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {
					new SqlParameter("@did", SqlDbType.Int,4)
			};
            parameters[0].Value = did;
            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }
        public int addmaterial(int id)
        {            
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into materialinfo(");
            strSql.Append("proid,usework,projectname,projecttype,supplier,material,nums,unit,suppliername,supplierphone,mbm,did,cguid,[unitPrice])");
            strSql.Append(" select proid,usework,projectName,projectTypeName,sname,material,pinum,unit,slink,sphone,mbm,did,uid,case isnull([unitPrice],'') when '' then '0' else unitPrice end as unitPrice from Vdistribution where did=" + id);
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                setuserproject(id);
                
            }
            return rows; 
          
        }
        public bool setuserproject(int id)
        {
            int uid = 0;
            string proid = "";
            bool r = true;
            string sql = "select [cly_userId] ,[proid]  FROM [Vdisequipment] where did=" + id;
            DataSet ds=DbHelperSQL.Query(sql.ToString());
            if (ds.Tables[0].Rows.Count == 1)
            {
                string cuid = ds.Tables[0].Rows[0]["cly_userId"].ToString();
                if(cuid!="")
                uid = int.Parse(cuid);
                proid = ds.Tables[0].Rows[0]["proid"].ToString();
                user_project u = new user_project();
                if (u.GetRecordCount(" materialinfo_proid='" + proid + "'") == 0)
                {
                    StringBuilder strSql = new StringBuilder();
                    strSql.Append("insert into user_project(");
                    strSql.Append("user_id,materialinfo_proid)");
                    strSql.Append(" values (");
                    strSql.Append("@user_id,@materialinfo_proid)");
                    strSql.Append(";select @@IDENTITY");
                    SqlParameter[] parameters = {
					new SqlParameter("@user_id", SqlDbType.Int,4),
					new SqlParameter("@materialinfo_proid", SqlDbType.NVarChar,50)
					};
                    parameters[0].Value = uid;
                    parameters[1].Value =proid;
                    object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
                    if (obj == null)
                    {
                        r = false;
                    }
                }
                else
                {
                    StringBuilder strSql = new StringBuilder();
                    strSql.Append("update user_project ");
                    strSql.Append(" set user_id=@user_id where materialinfo_proid=@materialinfo_proid");
                    SqlParameter[] parameters = {
					new SqlParameter("@user_id", SqlDbType.Int,4),
					new SqlParameter("@materialinfo_proid", SqlDbType.NVarChar,50)};
                    parameters[0].Value = uid;
                    parameters[1].Value = proid;
                    int i = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
                    if (i == 0)
                    {
                        r = false;
                    }
                }
            }
            return r;

        }
        public bool Updateaognum(int id,decimal num)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");           
            strSql.Append("aognum=@aognum ");            
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
					new SqlParameter("@aognum", SqlDbType.Float,8),					
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value =num;
            parameters[1].Value = id;        

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool delaognum(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");
            strSql.Append("aognum=0 ");
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
										
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool Updatepinum(int id, decimal num)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");
            strSql.Append("pinum=@pinum ");
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
					new SqlParameter("@pinum", SqlDbType.Float,8),					
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value = num;
            parameters[1].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {                
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool delpinum(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");
            strSql.Append("pinum=0 ");
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
								
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool Updatesta(int id, int sta)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");
            strSql.Append("dstate=@dstate ");
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
					new SqlParameter("@dstate", SqlDbType.Int,4),					
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value = sta;
            parameters[1].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool delsta(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");
            strSql.Append("dstate=NULL ");
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
										
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value =id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool Updatedis(dzs.Model.distribution model)
        {           
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set ");            
            strSql.Append("dnum=@dnum,");
            strSql.Append("reqstate=@reqstate,");
            strSql.Append("reqdate=@reqdate,");
            strSql.Append("dbatch=@dbatch,");            
            strSql.Append("handling=@handling,");
            strSql.Append("charges=@charges,");
            strSql.Append("linkman=@linkman,");
            strSql.Append("linkway=@linkway,");
            strSql.Append("handmode=@handmode ");            
            strSql.Append(" where did=@did");
            SqlParameter[] parameters = {					
					new SqlParameter("@dnum", SqlDbType.Float,8),
					new SqlParameter("@reqstate", SqlDbType.Int,4),
					new SqlParameter("@reqdate", SqlDbType.DateTime),
					new SqlParameter("@dbatch", SqlDbType.NVarChar,10),					
					new SqlParameter("@handling", SqlDbType.NVarChar,10),
					new SqlParameter("@charges", SqlDbType.Money,8),
					new SqlParameter("@linkman", SqlDbType.NVarChar,10),
					new SqlParameter("@linkway", SqlDbType.NVarChar,20),
					new SqlParameter("@handmode", SqlDbType.NVarChar,30),					
					new SqlParameter("@did", SqlDbType.Int,4)};
            parameters[0].Value = model.dnum;
            parameters[1].Value = model.reqstate;
            parameters[2].Value = model.reqdate;
            parameters[3].Value = model.dbatch;
            parameters[4].Value = model.handling;
            parameters[5].Value = model.charges;
            parameters[6].Value = model.linkman;
            parameters[7].Value =  model.linkway;
            parameters[8].Value =  model.handmode;
            parameters[9].Value = model.did;           

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
		/// <summary>
		/// 得到最大ID
		/// </summary>
		public int GetMaxId()
		{
		return DbHelperSQL.GetMaxID("did", "distribution"); 
		}

		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int did)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from distribution");
			strSql.Append(" where did=@did");
			SqlParameter[] parameters = {
					new SqlParameter("@did", SqlDbType.Int,4)
			};
			parameters[0].Value = did;

			return DbHelperSQL.Exists(strSql.ToString(),parameters);
		}

        public bool ConfirmList(string didlist,int sta)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution  set reqstate="+sta+",reqdate=getdate() ");
            strSql.Append(" where did in (" + didlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool userList(string didlist, int uid)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution  set uid=" + uid);
            strSql.Append(" where did in (" + didlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public bool userList(string didlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update distribution set distribution.uid=(select cgid from Vdistribution where Vdistribution.did=distribution.did) ");
            strSql.Append(" where did in (" + didlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(dzs.Model.distribution model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into distribution(");
			strSql.Append("gid,dnum,reqstate,dbatch,aognum,pinum,handling,charges,linkman,linkway,handmode,dstate,uid)");
			strSql.Append(" values (");
			strSql.Append("@gid,@dnum,@reqstate,@dbatch,@aognum,@pinum,@handling,@charges,@linkman,@linkway,@handmode,@dstate,@uid)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@gid", SqlDbType.Int,4),
					new SqlParameter("@dnum", SqlDbType.Float,8),
					new SqlParameter("@reqstate", SqlDbType.Int,4),					
					new SqlParameter("@dbatch", SqlDbType.NVarChar,10),
					new SqlParameter("@aognum", SqlDbType.Float,8),
					new SqlParameter("@pinum", SqlDbType.Float,8),
					new SqlParameter("@handling", SqlDbType.NVarChar,10),
					new SqlParameter("@charges", SqlDbType.Money,8),
					new SqlParameter("@linkman", SqlDbType.NVarChar,10),
					new SqlParameter("@linkway", SqlDbType.NVarChar,20),
					new SqlParameter("@handmode", SqlDbType.NVarChar,30),
					new SqlParameter("@dstate", SqlDbType.Int,4),
                                        new SqlParameter("@uid", SqlDbType.Int,4)};
			parameters[0].Value = model.gid;
			parameters[1].Value = model.dnum;
			parameters[2].Value = 0;
			parameters[3].Value = model.dbatch;
			parameters[4].Value = model.aognum;
			parameters[5].Value = model.pinum;
			parameters[6].Value = model.handling;
			parameters[7].Value = model.charges;
			parameters[8].Value = model.linkman;
			parameters[9].Value = model.linkway;
			parameters[10].Value =model.handmode; 
			parameters[11].Value =model.dstate;
            parameters[12].Value = model.uid;
			object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(dzs.Model.distribution model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update distribution set ");
			strSql.Append("gid=@gid,");
			strSql.Append("dnum=@dnum,");
			strSql.Append("reqstate=@reqstate,");
			strSql.Append("reqdate=@reqdate,");
			strSql.Append("dbatch=@dbatch,");
			strSql.Append("aognum=@aognum,");
			strSql.Append("pinum=@pinum,");
			strSql.Append("handling=@handling,");
			strSql.Append("charges=@charges,");
			strSql.Append("linkman=@linkman,");
			strSql.Append("linkway=@linkway,");
			strSql.Append("handmode=@handmode,");
			strSql.Append("dstate=@dstate");
			strSql.Append(" where did=@did");
			SqlParameter[] parameters = {
					new SqlParameter("@gid", SqlDbType.Int,4),
					new SqlParameter("@dnum", SqlDbType.Float,8),
					new SqlParameter("@reqstate", SqlDbType.Int,4),
					new SqlParameter("@reqdate", SqlDbType.DateTime),
					new SqlParameter("@dbatch", SqlDbType.NVarChar,10),
					new SqlParameter("@aognum", SqlDbType.Float,8),
					new SqlParameter("@pinum", SqlDbType.Float,8),
					new SqlParameter("@handling", SqlDbType.NVarChar,10),
					new SqlParameter("@charges", SqlDbType.Money,8),
					new SqlParameter("@linkman", SqlDbType.NVarChar,10),
					new SqlParameter("@linkway", SqlDbType.NVarChar,20),
					new SqlParameter("@handmode", SqlDbType.NVarChar,30),
					new SqlParameter("@dstate", SqlDbType.Int,4),
					new SqlParameter("@did", SqlDbType.Int,4)};
			parameters[0].Value = model.gid;
			parameters[1].Value = model.dnum;
			parameters[2].Value = model.reqstate;
			parameters[3].Value = model.reqdate;
			parameters[4].Value = model.dbatch;
			parameters[5].Value = model.aognum;
			parameters[6].Value = model.pinum;
			parameters[7].Value = model.handling;
			parameters[8].Value = model.charges;
			parameters[9].Value = model.linkman;
			parameters[10].Value = model.linkway;
			parameters[11].Value = model.handmode;
			parameters[12].Value = model.dstate;
			parameters[13].Value = model.did;

			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(int did)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from distribution ");
			strSql.Append(" where did=@did");
			SqlParameter[] parameters = {
					new SqlParameter("@did", SqlDbType.Int,4)
			};
			parameters[0].Value = did;

			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 批量删除数据
		/// </summary>
		public bool DeleteList(string didlist )
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from distribution ");
			strSql.Append(" where did in ("+didlist + ")  ");
			int rows=DbHelperSQL.ExecuteSql(strSql.ToString());
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}


		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public dzs.Model.distribution GetModel(int did)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select  top 1 did,gid,dnum,reqstate,reqdate,dbatch,aognum,pinum,handling,charges,linkman,linkway,handmode,dstate from distribution ");
			strSql.Append(" where did=@did");
			SqlParameter[] parameters = {
					new SqlParameter("@did", SqlDbType.Int,4)
			};
			parameters[0].Value = did;

			dzs.Model.distribution model=new dzs.Model.distribution();
			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}


		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public dzs.Model.distribution DataRowToModel(DataRow row)
		{
			dzs.Model.distribution model=new dzs.Model.distribution();
			if (row != null)
			{
				if(row["did"]!=null && row["did"].ToString()!="")
				{
					model.did=int.Parse(row["did"].ToString());
				}
				if(row["gid"]!=null && row["gid"].ToString()!="")
				{
					model.gid=int.Parse(row["gid"].ToString());
				}
				if(row["dnum"]!=null && row["dnum"].ToString()!="")
				{
					model.dnum=decimal.Parse(row["dnum"].ToString());
				}
				if(row["reqstate"]!=null && row["reqstate"].ToString()!="")
				{
					model.reqstate=int.Parse(row["reqstate"].ToString());
				}
				if(row["reqdate"]!=null && row["reqdate"].ToString()!="")
				{
					model.reqdate=DateTime.Parse(row["reqdate"].ToString());
				}
				if(row["dbatch"]!=null)
				{
					model.dbatch=row["dbatch"].ToString();
				}
				if(row["aognum"]!=null && row["aognum"].ToString()!="")
				{
					model.aognum=decimal.Parse(row["aognum"].ToString());
				}
				if(row["pinum"]!=null && row["pinum"].ToString()!="")
				{
					model.pinum=decimal.Parse(row["pinum"].ToString());
				}
				if(row["handling"]!=null)
				{
					model.handling=row["handling"].ToString();
				}
				if(row["charges"]!=null && row["charges"].ToString()!="")
				{
					model.charges=decimal.Parse(row["charges"].ToString());
				}
				if(row["linkman"]!=null)
				{
					model.linkman=row["linkman"].ToString();
				}
				if(row["linkway"]!=null)
				{
					model.linkway=row["linkway"].ToString();
				}
				if(row["handmode"]!=null)
				{
					model.handmode=row["handmode"].ToString();
				}
				if(row["dstate"]!=null && row["dstate"].ToString()!="")
				{
					model.dstate=int.Parse(row["dstate"].ToString());
				}
			}
			return model;
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select did,gid,dnum,reqstate,reqdate,dbatch,aognum,pinum,handling,charges,linkman,linkway,handmode,dstate ");
			strSql.Append(" FROM distribution ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			return DbHelperSQL.Query(strSql.ToString());
		}
        public DataSet GetListv(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT [did] ,[dnum],[reqstate],[reqdate],[dbatch],[aognum],[pinum],[handling],[charges],[linkman],[linkway],[handmode],[dstate],[supplyDate],[proid],[projectName],mbm,material,[dstatecn],sid,winBid,user_name,uid,arrivaladdress FROM [Vdistribution]");
            strSql.Append(" where 1=1");
            if (strWhere.Trim() != "")
            {
                strSql.Append(strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }
        public DataSet GetListdetailv(int did)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT [proid],[projectName],[supplyDate],[mbm],[material],[thisMonthCount],[unit],[unitPrice],[dnum],[reqstate],[reqdate],[dbatch],[aognum],[pinum],[handling],[charges],[linkman],[linkway],[handmode],[goodsQualityStatus],[goodsQualityStatusDate],[sendStatus],[sendStatusDate],[lastArrivalDate],[lastCheckedDate],[lastInstoreDate],[result],[arrivalAddress],[arrivallinkman],[contactWay],sname, slink, sphone,[dstate] FROM [Vdistribution] ");
            strSql.Append(" where did="+did);            
            return DbHelperSQL.Query(strSql.ToString());
        }

		/// <summary>
		/// 获得前几行数据
		/// </summary>
		public DataSet GetList(int Top,string strWhere,string filedOrder)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select ");
			if(Top>0)
			{
				strSql.Append(" top "+Top.ToString());
			}
			strSql.Append(" did,gid,dnum,reqstate,reqdate,dbatch,aognum,pinum,handling,charges,linkman,linkway,handmode,dstate ");
			strSql.Append(" FROM distribution ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			strSql.Append(" order by " + filedOrder);
			return DbHelperSQL.Query(strSql.ToString());
		}

		/// <summary>
		/// 获取记录总数
		/// </summary>
		public int GetRecordCount(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) FROM distribution ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			object obj = DbHelperSQL.GetSingle(strSql.ToString());
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("SELECT * FROM ( ");
			strSql.Append(" SELECT ROW_NUMBER() OVER (");
			if (!string.IsNullOrEmpty(orderby.Trim()))
			{
				strSql.Append("order by T." + orderby );
			}
			else
			{
				strSql.Append("order by T.did desc");
			}
			strSql.Append(")AS Row, T.*  from distribution T ");
			if (!string.IsNullOrEmpty(strWhere.Trim()))
			{
				strSql.Append(" WHERE " + strWhere);
			}
			strSql.Append(" ) TT");
			strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
			return DbHelperSQL.Query(strSql.ToString());
		}

		/*
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
					new SqlParameter("@PageSize", SqlDbType.Int),
					new SqlParameter("@PageIndex", SqlDbType.Int),
					new SqlParameter("@IsReCount", SqlDbType.Bit),
					new SqlParameter("@OrderType", SqlDbType.Bit),
					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
					};
			parameters[0].Value = "distribution";
			parameters[1].Value = "did";
			parameters[2].Value = PageSize;
			parameters[3].Value = PageIndex;
			parameters[4].Value = 0;
			parameters[5].Value = 0;
			parameters[6].Value = strWhere;	
			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
		}*/

		#endregion  BasicMethod
		#region  ExtensionMethod

		#endregion  ExtensionMethod
	}
}

